import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";

//获取模块数据
type moduleList = {
  status: number;
  msg: string;
  data: [
    {
      EntityId: number;
      SelectItemId: number;
      CreateTime: null;
      ModificationTime: null;
      SelectType: string;
      SelectId: string;
      SelectName: string;
      SelectContent: string;
      SortNo: number;
    }
  ];
};
type Score = {
  data: {
    list: [];
    pageIndex: number;
    pageSize: number;
    totalCount: number;
  };
  msg: string;
  status: number;
  success: boolean;
};
//获取团队成绩数据
export const GetTeamScore = (params?: string) => {
  return http.request<Score>(
    "post",
    baseUrlApi("/TaskSubmit/GetTeamScore?" + params)
  );
};

//获取个人成绩
export const GetPersonalScore = (params?: string) => {
  return http.request<Score>(
    "post",
    baseUrlApi("/TaskSubmit/GetPersonalScore?" + params)
  );
};
//获取答案数据

export const AnswerQuery = (data?: object) => {
  return http.request<moduleList>("post", baseUrlApi("/Answer/AnswerQuery"), {
    data
  });
};

//清除数据
export const ClearUserData = (params?: string) => {
  return http.request<Score>(
    "post",
    baseUrlApi("/ZSUser/ClearUserData?" + params)
  );
};

// 一键提交
export const AchievementOneTouchSubmit = (params?: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/Achievement/OneTouchSubmit?" + params)
  );
};

//导出个人成绩
export const ExportThats = (params?: string) => {
  return http.request<any>("get", baseUrlApi("/Achievement/ExportThats?" + params), {
  });
};


//导出团队成绩
export const ExportTeam = (params?: string) => {
  return http.request<any>("get", baseUrlApi("/Achievement/ExportTeam?" + params), {
  });
};
